package rtti;

import framework.AbstractTest;
import utils.Log;

import java.util.Arrays;
import java.util.List;

/**
 * Created by shane on 2018/6/11.
 */

abstract class Shape {

   void draw() {
       Log.vn(this + ".draw");
   }

    public abstract String toString();
}


class Circle extends Shape {

    @Override
    public String toString() {
        return "Circle";
    }
}

class Square extends Shape {

    @Override
    public String toString() {
        return "Square";
    }
}

class Triangle extends Shape {

    @Override
    public String toString() {
        return "Triangle";
    }
}

public class Shapes extends AbstractTest {
    @Override
    public void test(String[] args) {
        super.test(args);

        List<Shape> shapeList = Arrays.asList(new Circle(), new Square(), new Triangle());
        for (Shape shape : shapeList) {
            shape.draw();
        }
    }
}
